package com.hsmw.api.utils;

import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hsmw.domain.vo.OrderPoolVO;

import java.util.ArrayList;
import java.util.List;

public class JSONUtils {
    public static List<OrderPoolVO> transferJSONToBean(List<JSONObject> result){
        List<OrderPoolVO> res = new ArrayList<>();
        if(CollectionUtil.isNotEmpty(result)){
            for(JSONObject object:result){
                OrderPoolVO u = JSON.parseObject(object.toJSONString(), OrderPoolVO.class);
                res.add(u);
            }
        }
        return res;
    }
}
